Commands / Install-sqmOlaMaintenanceSolution
Install-sqmOlaMaintenanceSolution
Configuration sqmSQLTool v1.8.2+ · Installation ✓ -WhatIf supported  🛠 Pipeline
Downloads the latest version of Ola Hallengren's Maintenance Solution from GitHub and installs the database objects (stored procedures and tables) on one or more SQL Server instances.

Execution order: 1. CommandExecute.sql 2. CommandLog.sql 3. DatabaseBackup.sql 4. DatabaseIntegrityCheck.sql 5. IndexOptimize.sql

Note: This function creates only the objects (stored procedures and tables), not the SQL Agent jobs. Jobs are created separately using dedicated functions (e.g., New-sqmOlaBackupJobs).

Parameters

ParameterTypeRequiredDefaultNotes
-SqlInstancestring[]Optional$env:COMPUTERNAMEOne or more instances. Pipeline-capable.
-SqlCredentialPSCredentialOptionalCredentials for all SQL connections.
-SourcePathstringOptionalGitHub ZIP URLAlternative source for the ZIP archive.
-ForceswitchSwitch$falseOverwrite existing installation.
-UpdateswitchSwitch$falseAlias for -Force (update mode).
-ContinueOnErrorswitchSwitch$falseContinue to next instance on error.
-EnableExceptionswitchSwitch$falseRe-throw exceptions instead of collecting results.
-WhatIf / -ConfirmswitchOptionalShouldProcess (ConfirmImpact: None) guards the installation step.

Examples

Install Ola Maintenance Solution on SQL01
Install-sqmOlaMaintenanceSolution -SqlInstance "SQL01"
Reinstall (update) existing Ola installation
Install-sqmOlaMaintenanceSolution -SqlInstance "SQL01" -Force
Install on multiple instances via pipeline, continue on error
"SQL01","SQL02","SQL03" | Install-sqmOlaMaintenanceSolution -ContinueOnError